﻿using HolaMundoMVC4.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HolaMundoMVC4.Controllers
{
    public class HomeController : Controller
    {
        // gsfsdsd
        // GET: /Home/
        //mod mod
        //YA LO CAMBIE

        public ActionResult Index()
        {
            var laListaDeAlumnos = AlumnoContenedor.alumnos;
            return View(model: laListaDeAlumnos);
        }

        [HttpGet]
        public ActionResult Agregar()
        {
            return View();
        }

        [HttpGet]
        public ActionResult Eliminar()
        {
            return View();
        }

                
        [HttpPost]
        public ActionResult Agregar(Alumno alumno)
        {
            AlumnoContenedor.agregarAlumno(alumno); 
            return RedirectToAction("Index");
        }


        [HttpPost]
        public ActionResult Eliminar(Alumno alumno)
        {
            AlumnoContenedor.eliminarAlumno(alumno);
            return RedirectToAction("Index");
        }



    }
}
